Principles of writing code
Things you need to know when your publishing When your publishing content, the only things you should be worried about are: is what I am saying correct? Have I said it correctly? When I wrote the code, does it work? etc. When writing, and writing code either on your website/blog or for us, it's always better to make sure that what you are writing is right, and in a context that people can understand and use. For example, right as I write this article, I have a developer (James Gunn) testing out some software that I created. The software is going to be announced on September 15th, and should come out of testing on the 30th of that month. When I was going to write the code, I needed to make sure that all my codes were in proper order. For example, when I imagine me as a user publishing this software on my site, I want it to be short and quick. Therefore, I created a few JavaScripts and extended it for a few lines of code. In short, I'm thinking of the user. The thing is, when I do this, how am I going to lay this out? A perfect example.... A great example is me in the css. Going back to the software I was going to create (Darkcentral Connect) I was that instead of having six types of Cascading Style sheets, I would combine it in one. So I Copy and pasted all the css files into one huge file (5000 lines of CSS!) and created one huge file called: Ultimate.css. Now when I was going to run the program, I noticed that it didn't work! The iFrame shoutbox was a disaster. None of the functions worked, and worst of all: everything was all spread out, and looked horrible!! So I came up with a plan - instead of screeming to the heavens, I did this: I ended the CSS file, and then broke it up with a comment. Yeah, you might think it didn't work, and I couldn't do it. I was sitting on my chair just thinking, until I forgot to break a few lines of code up. So I tried a break, but nothing worked. I added a comment and put some tag (I really can't remember) that ended the css. After the ending tag, I started the css again from a new start tag (after the comment line break) and started the next section again. Now I wasted my week thinking so hard, but I accomplished so many things: Thinking of the user, a new problem to fix, and something interesting when I was REALLY bored as hell. When something doesn't work This goes out to everyone. If some piece of code doesn't work, then re-read everything over. I'll give you an example. I was creating a Facebook Comments box on my site, and there were a few components of JavaScript. When my box never worked, I focused on the JavaScript by going into the Facebook server JavaScript function libarary. I searched everthing, and it took me more than a week. I remembered something about a reciever file, and I looked back and was bored. I was just lookinig back at stuff I already new and was so bored. So I researched the Facebook Wiki and I wasted my time. Then I went back to the tutorial, and it said: "make sure your xd reciever file is pointed in the right direction. So I went back and did everything, and put the files on my server. Guess what, IT WORKED!!! Now the thing I overlooked is the file having the right code. I took the wrong code, and that's the whole reason I didn't work. The problem was that I didn't read everything to full to get it over with, and then when I looked over, I was too bored because I never thought this would be the problem. So when you have a problem, always look over and test because the part you over look, is the most often solution to your problem. So remember, revise and test - it helps. I just finished the comments box and ready to announce and bring it live on September 1st. Get ready people, because Darkcentral is a new mode....... So times are wasting, find out soon about Darkcentral Connect. We are creating a page very soon.